#include "stdafx.h"
#include "./luaclass.h"

LuaClass::LuaClass(lua_State* luaState, int classid)
: m_luaState(luaState)
, m_classid(classid)
{
}

void LuaClass::operator [](const Scope& scope) const
{
	lua_rawgeti(m_luaState, LUA_REGISTRYINDEX, m_classid);
	scope.Register(m_luaState, false);
	lua_pop(m_luaState, 1);
}